package com.yp.infrastructure.mdb.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 多数据源配置
 */
@Configuration
@ConfigurationPropertiesScan
@ConfigurationProperties(prefix = "mdb")
public class MultiDatasourceConfig {

    /**
     * 配置说明
     */
    private String desc;

    /**
     * 多数据源配置，也可只一个数据源
     */
    @NestedConfigurationProperty
    private DataSourceProperties[] databases;

    public DataSourceProperties[] getDatabases() {
        return databases;
    }

    public void setDatabases(DataSourceProperties[] databases) {
        this.databases = databases;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }



}